Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: SSAPI Auth Token (BPS-281) #1990

Merged
merged 6 commits into from
Dec 2, 2024

Conversation

Caleb-Hurshman
Copy link

Proposed Change

Adds auth tokens as an authentication option in addition to basic auth.

Checklist
  • Changes are tested
  • CI has passed

@Caleb-Hurshman Caleb-Hurshman requested review from dpaasman00 and a team as code owners November 21, 2024 21:17
@Caleb-Hurshman
Copy link
Author

Test failures are because I copied over a test file from the other PR to add to it. The failure should be resolved once the unit test PR gets merged.

@@ -51,12 +58,27 @@ func (cfg *Config) Validate() error {
if cfg.Endpoint == "" {
return errors.New("missing Splunk server endpoint")
}
if cfg.Username == "" {

if cfg.Username == "" && cfg.AuthToken == "" {
return errors.New("missing Splunk username")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we update this error string?

Suggested change
return errors.New("missing Splunk username")
return errors.New("missing Splunk username or auth token")

return errors.New("missing Splunk username")
}
if cfg.Password == "" {

if cfg.Password == "" && cfg.AuthToken == "" {
return errors.New("missing Splunk password")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return errors.New("missing Splunk password")
return errors.New("missing Splunk password or auth token")

@@ -111,22 +111,32 @@ func (ssapir *splunksearchapireceiver) Shutdown(ctx context.Context) error {

func (ssapir *splunksearchapireceiver) runQueries(ctx context.Context) error {
for _, search := range ssapir.config.Searches {
// set default event batch size
fmt.Println(search.EventBatchSize)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fmt.Println(search.EventBatchSize)

fmt.Println(search.EventBatchSize)
if search.EventBatchSize == 0 {
search.EventBatchSize = 100
fmt.Println(search.EventBatchSize)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
fmt.Println(search.EventBatchSize)

@Caleb-Hurshman Caleb-Hurshman merged commit b2f0bbf into feat/ssapi-receiver Dec 2, 2024
14 checks passed
@Caleb-Hurshman Caleb-Hurshman deleted the feat/ssapi-auth-token branch December 2, 2024 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants